<?php 
Class msgController extends appController
{

	public function index()
	{
		$page=isset($_REQUEST['page'])?intval($_REQUEST['page']):1;
		
		$list=Model('msg')->get_msg_list($page);
		
		$this->assign('msg_list',$list['data']);
		$this->assign('menu_page',$list['pagelink']);
		$this->assign('ur_here','>留言管理');
		$this->display('index.html');
		
	}
	public function get_detail()
	{
		$id=isset($_REQUEST['id'])?intval($_REQUEST['id']):'';
		$result=Model('msg')->get_msg_info($id);
		if($result)
		{
		print_r(json_encode($result));
		}
	}
	public function del()
	{
		$id=isset($_REQUEST['id'])?$_REQUEST['id']:'';
		
		if(is_array($id))
		{
			
			foreach($id as $k=>$v)
			{
				$result=Model('msg')->del_msg($v);
			}
		}
		else
		{
			$id=intval($id);
				
			$result=Model('msg')->del_msg($id);
		}
		print_r(json_encode($result));
	}
	
	
	
	
}